﻿using System;
using EmbeddedSharp.Core;

namespace EmbeddedSharp.Scripting.Function.Context {
    public class TypeNode : FuncNode {
        public TypeNode()
            : base("type") {
        }

        public override object Evaluate() {
            if (Parameters.Count < 1) {
                throw new ArgumentException(
                    "usage: type(expr)");
            }

            Node root = Parameters[0];

            return root.Type;
        }
    }
}
